from five import grok
from zope import schema
from plone.directives import form

from plone.app.textfield import RichText

from optilux.cinemacontent import CinemaMessageFactory as _

# Indexer
from plone.indexer import indexer

class IRegistration(form.Schema):
    """A registration, which also may contain reservations and invoices
    """

    lastname = schema.ASCIILine(
            title=_(u"Last Name"),
            description=_(u""),
            required=True
        )

    firstname = schema.ASCIILine(
            title=_(u"First Name"),
            description=_(u""),
            required=True
        )

    address = schema.ASCIILine(
            title=_(u"Address"),
            description=_(u""),
            required=True
        )

    city = schema.ASCIILine(
            title=_(u"City"),
            description=_(u""),
            required=True
        )

    postalcode = schema.ASCIILine(
            title=_(u"Postal Code"),
            description=_(u""),
            required=False
        )

class View(grok.View):
    """Default view (called "@@view") for a registration.

    The associated template is found in registration_templates/view.pt.
    """

    grok.context(IRegistration)
    grok.require('zope2.View')
    grok.name('view')
